#!/bin/perl -w

# for Mac Platform (darwin)
my $ChromeApp="/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome";
# for Linux Platform (linux)
my $ChromePath="google-chrome";
# for Windowa Platform (MSWin32)
my $Chrome32="";

my $ExtensionName="SearchByDictionary";

# Checking Platform 
my $Platform = $^O;
print "Starting build extension on platform $Platform...\n";

# Run auto build
if ( $Platform =~ /darwin/ ) {
	system("$ChromeApp --pack-extension=$ExtensionName --pack-extension-key=$ExtensionName.pem");
}
if ( $Platform =~ /linux/ ) {
	system("$ChromePath --pack-extension=$ExtensionName --pack-extension-key=$ExtensionName.pem");
}
if ( $Platform =~ /MSWin32/){
	system("$Chrome32 --pack-extension=$ExtensionName --pack-extension-key=$ExtensionName.pem");
}
print "End of build\n";
#/Applications/Google\Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=SearchByDictionary --pack-extension-key=SearchByDictionary.pem










